Revert "try truncateFilePath on windows again"
authorJoey Hess <joeyh@joeyh.name>
Thu, 30 Jan 2025 21:43:38 +0000 (17:43 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 30 Jan 2025 21:43:38 +0000 (17:43 -0400)
This reverts commit 0d4abbcb92ff40e90cbc44f3d1a42243bdbae2ba.

Test suite was failing again with that.

Annex/ReplaceFile.hs

index 5cb46b17dd7d0dbeed45308901e6fd2759c03918..3af555d39dc415a5d33cac222036cf70838c94c2 100644 (file)
@@ -5,6 +5,8 @@
  - Licensed under the GNU AGPL version 3 or higher.
  -}
 
+{-# LANGUAGE CPP #-}
+
 module Annex.ReplaceFile (
        replaceGitAnnexDirFile,
        replaceGitDirFile,
@@ -57,7 +59,11 @@ replaceFile createdirectory file action = replaceFile' createdirectory file (con
 
 replaceFile' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a
 replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do
+#ifndef mingw32_HOST_OS
        let basetmp = relatedTemplate' (P.takeFileName file)
+#else
+       let basetmp = toRawFilePath "t"
+#endif
        withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do
                let tmpfile = toRawFilePath tmpdir P.</> basetmp
                r <- action tmpfile